package com.quanyan.place.web;

import com.quanyan.api.APIResponse;
import com.quanyan.place.entity.TbBizPlaceEmployee;
import com.quanyan.place.entity.apireq.ReqSetPlacePeriod;
import com.quanyan.place.entity.vo.EmployeeFormDataVo;
import com.quanyan.place.service.EmployeeService;
import com.quanyan.place.service.PeriodService;
import com.quanyan.place.service.impl.VisitedService;
import com.quanyan.place.wrapper.CommerceEmployeeWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by liuyaoxin on 2016/6/16.
 */

@RestController
@RequestMapping("/admin/api/place/period")
public class PeriodController {
   @Autowired
   PeriodService periodService;

    private Logger logger = LoggerFactory.getLogger(PeriodController.class);

    /**
     * 根据uid查询商务信息
     * @param placeId
     * @return
     */
   @RequestMapping(value="/getPeriodInfoByPlaceId",method = RequestMethod.GET)
   public APIResponse<?>getPeriodInfoByPlaceId(@RequestParam(value = "placeId", required = false)Integer placeId){
        return  APIResponse.returnSuccess(periodService.getPeriodInfoByPlaceId(placeId));
   }


    @RequestMapping(value="/getDataByPlaceId",method = RequestMethod.GET)
    public APIResponse<?>getDataByPlaceId(@RequestParam(value = "placeId", required = false)Integer placeId){
        return  APIResponse.returnSuccess(periodService.getDataByPlaceId(placeId));
    }

       /*
    修改锁定时长



     */

    @RequestMapping(value = "/updatePlaceLockDays",method = RequestMethod.POST)
    public APIResponse<?> updatePlaceLockDays(@RequestBody ReqSetPlacePeriod reqSetPlacePeriod){
        APIResponse result=periodService.updatePlaceLockDays(reqSetPlacePeriod);
        return result;
    }

}
